<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<title>借  支  申  请  单</title>
<script>
	$(function(){
		var gridParam = {
			url:"/console/com.fs.jzzn.pojo.NoteDebit/list",
			sort:"createTime",
			order:"desc",
			queryParams:{
				rightControl: true
			},
			columns:[[
				{field:"invoiceNo",title:"单据编号", width:120 }
				,{field:"pNo",title:"对象编号", width:180 }
				,{field:"signNo",title:"外经证", width:100  }
				,{field: "billTitle", title: "发票标题(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
				,{field: "billNo", title: "开票编号(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
				,{field: "billDate", title: "开票日期(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
				 ,{field: "money", title: "开票金额(总)", width: 100,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } ,formatter:function(value,row,index){
		    		 return parseFloat(value||0).toLocaleString();
		    	 }}
				 ,{field: "billType", title: "发票类型(总)", width: 120,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
				 ,{field: "taxRate", title: "税率(总)", width: 100,styler: function(value,row,index){ return "background-color:#E6EEF8;"; } }
				 ,{field: "billName", title: "开票单位(总)", width: 80,styler: function(value,row,index){ return "background-color:#E6EEF8"; } }
				 ,{field: "operator", title: "经办人(总)", width: 80,styler: function(value,row,index){ return "background-color:#E6EEF8"; } }
				 ,{field: "billTitleF", title: "发票标题(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
				,{field: "billNoF", title: "开票编号(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
				,{field: "billDateF", title: "开票日期(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
				 ,{field: "moneyF", title: "开票金额(分)", width: 100,styler: function(value,row,index){ return "background-color:#ECFEF8;"; },formatter:function(value,row,index){
		    		 return parseFloat(value||0).toLocaleString();
		    	 }}
				 ,{field: "billTypeF", title: "发票类型(分)", width: 120,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
				 ,{field: "taxRateF", title: "税率(分)", width: 100,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
				 ,{field: "billNameF", title: "开票单位(分)", width: 80,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }}
				 ,{field: "operatorF", title: "经办人(分)", width: 80,styler: function(value,row,index){ return "background-color:#ECFEF8;"; }} 
				 ,{field: "moneyNoRate", title: "不含税金额", width: 120 ,formatter:function(value,row,index){
		    		 return parseFloat(value||0).toLocaleString();
		    	 }}
		    	,{field: "moneyRate", title: "税额", width: 120 ,formatter:function(value,row,index){
		    		 return parseFloat(value||0).toLocaleString();
		    	 }}
		    	,{field: "remark", title: "备注", width: 120}
		    	 ,{field: "orgNo", title: "所属机构", width: 180 ,formatter: function(value,row,index){
						return (value || '') + '-' + (row.orgNoName|| '') ;
				 }}
				,{field : "createTime",width : 130,title: "创建时间"}
				,{field : "createrName",width : 130,title: "创建人"}
			]],
			onLoadSuccess: function(){
				p.tooltip([ 'signNo', 'billTitle', 'billNo' ,'billName' , 'billTitleF' , 'billNoF' ,'billNameF' ,'remark','pNo']);
			}
		};
		p.dataGrid = $(p.dataGrid).datagrid($.extend({}, p.dataGridParam,gridParam));
		/*事件响应*/
		$("#toolbar .easyui-linkbutton").on("click", function() {
			var motion_code = $(this).attr("motion_code");p.btnOneClick($(this));
			switch (motion_code) {
				case "01":
					p.gridAdd({title : "发票新增" ,width : 850, height : 430,autoMax:true });
					break;
				case "02":
					p.gridModify({title : "发票编辑" ,width : 850, height : 430,autoMax:true });
					break;
				case "03":
					p.gridDelete({ msg:"您确认删除当前选中发票记录？" });
					break;
				case "04":
					p.gridView({title : "发票查看" ,width : 850, height : 430 ,autoMax:true});
					break;
				case "05":
					p.gridQuery();
					break;
				case "07":
					p.down({filename:'工程发票'});
					break;
				case "19":
					p.gridAdd({href:'/console/invoice/import', title : "工程发票数据导入", width : 550, height : 330 });
					break;
				default:
					break;
				}
		});
	});
</script>
</head>
<body class="easyui-layout">
	<!-- 但行高度33px，多行时 33乘以行数  -->
	<div data-options="region:'north',split:false,border:false" style="height:auto;">
		<div class="easyui-panel" data-options="fit:true,border:false">
			<!-- 查询条件表单，根据配置进行替换  -->
		<form id="queryForm" >
		 		<input type="hidden" name="className" value="com.fs.jzzn.pojo.Invoice" />
			
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="invoiceNo" style="width:240px;" data-options="label:'单据编号:',required:false" />
				<input type="hidden" name="invoiceNo_searchType" value="like" />
			</div>
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="billTitle" style="width:240px;" data-options="label:'标题(总):',required:false" />
				<input type="hidden" name="billTitle_searchType" value="like" />
			</div>
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="billNo" style="width:240px;" data-options="label:'编号(总):',required:false" />
				<input type="hidden" name="billNo_searchType" value="like" />
			</div>
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="pNo" style="width:240px;" data-options="label:'对象编号:',required:false" />
				<input type="hidden" name="pNo_searchType" value="like" />
			</div>
			
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="signNo" style="width:240px;" data-options="label:'外经证:',required:false" />
				<input type="hidden" name="signNo_searchType" value="like" />
			</div>
			
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="billTitleF" style="width:240px;" data-options="label:'标题(分):',required:false" />
				<input type="hidden" name="billTitleF_searchType" value="like" />
			</div>
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="billNoF" style="width:240px;" data-options="label:'编号(分):',required:false" />
				<input type="hidden" name="billNoF_searchType" value="like" />
			</div>
			
			<div style="margin-top:5px;margin-left:10px;float:left;">
			  	<select class="easyui-combobox" name="billType" style="width:240px;" data-options="label:'发票类型:' " 
					url="/console/combobox?valueField=dicName&textField=dicName&modleName=dictionary&pCode=B7&pCode_searchType=eq" >
			    </select>
				<input type="hidden" name="billType_searchType" value="like" />
			 </div>
			
			<div style="margin-top:5px;margin-left:10px;float:left;">
		    	<select class="easyui-combotreegrid" name="orgNo" style="width:240px;" data-options="label:'所属机构:',panelWidth:250,
	           	idField: 'orgNo', 
	           	missingMessage:'必填项',
				treeField: 'orgName',
				sortName:'orgOrder',
				onSelect:function(row){
					$('input[name=department]').val(row.orgName);	    
				},
				sortOrder:'asc',
	            url:'/console/com.fs.base.pojo.Org/list', 
	            queryParams:{isTreeGrid:'true', treeId:'id', treePid:'parentId' },
	            columns:[[    
	                {field:'orgName',			width:190,	title:'组织名称' }
	            ]]"></select>
		  		<input type="hidden" name="orgNo_searchType" value="like" />
		 	</div>
		<div class="fItem">
	  		<input class="easyui-combobox" name="createrId" style="width:240px;" url="/console/combobox?valueField=id&textField=nickName&modleName=user" data-options="label:'创建人:',required:false" />
	  		<input type="hidden" name="createrId_searchType" value="eq" />
	 	</div>
	 	
	 	<div class="fItem">
		 	<input class="easyui-datebox" style="width:240px;" name="createTime" data-options="label:'开始日期:',required:false" />
		 	<input type="hidden" name="createTime_searchType" value="between" />
		 	<input type="hidden" name="createTime_format" value="date" />
		</div>
		<div class="fItem">
		 	<input class="easyui-datebox" style="width:240px;" name="createTime" data-options="label:'截至日期:',required:false" />
		</div>
		</form>
		</div>
	</div> 
	<!-- 工具栏按钮 -->
	<div id="toolbar" class="easyui-panel" style="padding:3px;">
	</div>
	
	<!-- 表格 -->
	<div region="center" border="false">
		<table id="dataGrid"></table>
	</div>
</body>
</html>